FROM registry.cn-hangzhou.aliyuncs.com/bkhech-custom/jdk-debian-slim:17.0.13-1.0.0

MAINTAINER bkech

RUN mkdir -p /mydata/logs

WORKDIR /mydata

ENV SERVER_PORT=875 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Xms64m -Xmx128m -XX:+UseZGC -XX:+HeapDumpOnOutOfMemoryError  -XX:HeapDumpPath=/mydata/logs/heapdump.hprof" PROFILE=dev
EXPOSE ${SERVER_PORT}

ADD ./target/chat-server.jar ./app.jar

ENTRYPOINT ["sh", "-c", "java -Djava.security.egd=file:/dev/./urandom ${JAVA_OPTS} -jar app.jar ${SERVER_PORT}"]